package com.campus.wall.adapter;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.campus.wall.R;
import com.campus.wall.response.MessageResponse;

import java.util.List;

public class PlaceAdapter extends RecyclerView.Adapter<PlaceAdapter.MyHolder> {

    private List<MessageResponse> mList;//数据源
    private Activity activity;
    private LayoutInflater mInflater;

    public PlaceAdapter(List<MessageResponse> list, Activity activity) {
        mList = list;
        this.activity=activity;
        this.mInflater = LayoutInflater.from(activity);
    }
    @NonNull
    @Override
    public MyHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View view =mInflater
                .inflate(R.layout.layout_place_item, parent, false);
        MyHolder holder = new MyHolder(view);
        return holder;
    }

    @Override
    public void onBindViewHolder(@NonNull MyHolder holder, int position) {
        MessageResponse messageResponse= mList.get(position);

    }

    @Override
    public int getItemCount() {
        return mList.size();
    }

    class MyHolder extends RecyclerView.ViewHolder {



        public MyHolder(@NonNull View itemView) {
            super(itemView);

        }
    }
}
